package gof.com.yew.decorator;

public class DecoratorDemo01 {
	
	public static void main(String[] args) {
		ICar car = new AudiCar();
		car.run();
		
		System.out.println("增加性能，车可以飞");
		ICar fly = new FlyCarDecorator(car);
		fly.run();
		
		System.out.println("增加性能，车可以自动行驶");
		ICar aiCar = new AICarDecorator(car);
		aiCar.run();
		
		System.out.println("增加性能，飞和自动行驶");
		ICar topCar = new AICarDecorator(fly);
		topCar.run();
	}

}
